package com.jason.www.strategy_pattern.demo1;

import com.jason.www.strategy_pattern.demo1.core.TranslationContext;
import com.jason.www.strategy_pattern.demo1.stategy.ChineseTranslationStategy;
import com.jason.www.strategy_pattern.demo1.stategy.JapaneseTranslationStategy;

public class StategyTest {

    public static void main(String[] args) {
        String english = "hello";

        TranslationContext translationContext = new TranslationContext(new ChineseTranslationStategy());
        String chinese = translationContext.translate(english);
        translationContext.setStategy(new JapaneseTranslationStategy());
        String japanese = translationContext.translate(english);
        System.out.println("english:" + english);
        System.out.println("chinese:" + chinese);
        System.out.println("japanese:" + japanese);
    }
}
